package com.liang.jiekou.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.liang.jiekou.entity.INVMB;
import com.liang.jiekou.entity.PURMA;
import com.liang.jiekou.service.COPMAService;
import com.liang.jiekou.service.PURMAService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: LiangPanDeng
 * @Date: 2024/01/17/11:46
 * @Description: 供应商基本信息档
 */

@Api(tags = "供应商信息控制器")
@RestController
@RequestMapping("/gys")
public class PURMAController {
    @Resource
    private PURMAService purmaService;

    @ApiOperation("供应商信息分页")
    @GetMapping("/page")
    public ResponseEntity<IPage<Map<String, Object>>> page(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer pageSize){
        Page<PURMA> paging = new Page<>(page, pageSize);

        IPage<Map<String, Object>> result = purmaService.page(paging);
        System.out.println(result);
        return ResponseEntity.ok().body(result);
    }
}
